// This version of Sass doesn't like using string MQ's apparently.
// $mini: "(max-width: 500px)";

// Reset
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.warning {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 0.5rem;
  background: linear-gradient(#fff94d, #ddd610);
  opacity: 0.95;
  text-align: center;
  z-index: 1000;
}

// to avoid extranaous animations while page settles
.no-transitions,
.no-transitions * {
  transition: none !important;
}

// clearfix
.group:after {
  content: "";
  display: block;
  clear: both;
}

:root { // rem
  font-size: large;
  line-height: 1.4;
  @media (max-width: 500px) {
    font-size: small;
  }
}

// is needed for overlay
html, body {
  height: 100%;
  // testing
  overflow: hidden;
}

body {
  background: #eee;
  font-family: Sans-serif;
  overflow: hidden; // for logo effect

  // This is kinda good for performance overall
  // But... you can't fixed position inside it then
  // transform: translateZ(0);

  @media (max-width: 500px) {
  }
}

// Layout
.page-wrap {
  // Required for non-janky off-screen squishing
  float: right;
  width: 100%;
}

.effeckt {
  padding: 2rem;
  background: white;
  margin: 0 0 1rem 0;
  @media (max-width: 500px) {
    padding: 1.5rem;
  }
  header {
    margin: 0 0 1rem 0;
    border-bottom: 2px solid #eee;
    position: relative;
    .source {
      position: absolute;
      right: 0;
      bottom: 2px;
      @media (max-width: 500px) {
        position: relative;
        display: block;
        margin: 0.2rem 0;
      }
    }
    &:nth-of-type(n+2) { // all but first
      margin-top: 2rem;
    }
  }
}
.button-group {
  line-height: 2;
}



// Typography
a {
  text-decoration: none;
  color: #ccc;
}
a:hover, a:active {
  color: black;
}
subhead {
  display: block;
  font-size: 1.4rem;
  margin: 0 0 2rem 0;
}
.mobile-break {
  display: none;
  @media (max-width: 500px) {
    display: block;
  }
}
h1 {
  margin: 0 0 1rem 0;
  @media (max-width: 500px) {
    line-height: 0.8;
  }
}
h1 span {
  font-size: 1.5rem;
  position: relative;
  display: inline-block;
  opacity: 0;
  width: 50px;
  height: 50px;
  line-height: 50px;
  background: #ccc;
  color: white;
  text-align: center;
  text-transform: uppercase;
  @media (max-width: 500px) {
    font-size: 0.8rem;
    width: 28px;
    height: 28px;
    line-height: 28px;
  }
}
h2 {
  margin: 0;
}
h3 {
  margin: 0;
}
h4 {
  margin: 0 0 0.5rem 0;
}
p, ul, ol, blockquote, pre {
  margin: 0 0 1rem 0;
}

button {
  padding: 0.25rem;
}

hr {
  height: 0;
  border: 0;
  border-top: 1px solid #ccc;
}

h1 span:nth-of-type(1) {
  animation: logo-from-horz 0.5s ease forwards;
  transform: translateX(-50px);
  background: #666;
}
h1 span:nth-of-type(2) {
  animation: logo-from-vert 0.5s 0.1s ease forwards;
  transform: translateY(-50px);
  background: #444;
}
h1 span:nth-of-type(3) {
  animation: logo-from-vert 0.5s 0.2s ease forwards;
  transform: translateX(50px);
  background: #666;
}
h1 span:nth-of-type(4) {
  animation: logo-from-horz 0.3s 0.3s ease forwards;
  transform: translateX(50px);
  background: #444;
}
h1 span:nth-of-type(5) {
  animation: logo-from-horz 0.3s 0.4s ease forwards;
  transform: translateX(-50px);
  background: #666;
}
h1 span:nth-of-type(6) {
  animation: logo-from-horz 0.3s 0.5s ease forwards;
  transform: translateX(50px);
  background: #444;
}
h1 span:nth-of-type(7) {
  animation: logo-from-vert 0.3s 0.6s ease forwards;
  transform: translateY(-50px);
  background: #666;
}
h1 span:nth-of-type(8) {
  animation: logo-from-horz 0.2s 1.1s ease forwards;
  transform: translateX(1000px);
  background: none;
  color: black;
}
h1 span:nth-of-type(9) {
  animation: logo-from-horz 0.2s 1.1s ease forwards;
  transform: translateX(1000px);
}
h1 span:nth-of-type(10) {
  animation: logo-from-horz 0.2s 1.1s ease forwards;
  transform: translateX(1000px);
}
h1 span:nth-of-type(11) {
  animation: logo-from-horz 0.2s 1.1s ease forwards;
  transform: translateX(1000px);
}
@keyframes logo-from-horz {
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes logo-from-vert {
  100% { transform: translateY(0); opacity: 1;}
}




// Contributors
.contributors {
  background: #222;
  color: #eee;
  header {
    border-bottom-color: #666;
  }
  ol { margin-left: 35px; }
  hr { margin: 15px 0; }
}
.fluid-video {
  height: 0;
  padding-top: 62.5%;
  position: relative;
  iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
}




// Individual demos, not specific to style

.button-demo-wrap {
  width: 35%;
  float: left;
  &:nth-child(2n) {
    clear: both;
  }
  @media (max-width: 500px) {
    width: 100%;
    float: none;
  }
}


.effeckt-list-wrap {
  width: 50%;
  float: left;
  margin: 0 0 2rem 0;
  &:nth-child(even) {
    clear: both;
    padding-right: 20px;
  }
}


.effeckt-demo-list-scroll {
  > ul {
    width: 32%;
    float: left;
    margin-right: 2%;
    margin-bottom: 2%;
    &:nth-of-type(3n) {
      margin-right: 0;
    }
    @media (max-width: 500px) {
      width: 100%;
      float: none;
      height: 250px;
      margin: 0 0 1rem 0;
    }
  }
}


.effeckt-toggle-demo {
  min-height: 220px;
}
[data-toggle-trigger] { // Toggle buttons
  margin-bottom: 20px;
}

.effeckt-modal {
  background: white;
  h3 {
    padding: 1rem;
    color: white;
    background: #444;
  }
}


.effeckt-modal-content {
  padding: 1rem;
}

.effeckt-modal-overlay {
  z-index: 1000;
  background: rgba(black, 0.5);
}

// Pisitional Modal
.effeckt-positional-modal-wrap {
  .effeckt-modal {
    padding: 10px;
    background: #ccc;
  }
  .effeckt-modal-content {
    background: white;
  }
}


// Buttons
.effeckt-button {
  background: #444;
  color: white;
  border: 0;
  padding: 0.8rem 1rem;
  font-family: inherit;
  font-size: 1.3em;
  margin: 0 0.25rem 0.6rem 0;
  white-space: nowrap;
  cursor: pointer;
  outline: none;
  // As of 8-17-13, Autoprefixer does not catch these
  -webkit-appearance: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(black, 0);
}

.effeckt-button[data-effeckt-type="3d-rotate-success"]:after {
  background: #7aca7c;
  color: #358337;
}
.effeckt-button[data-effeckt-type="3d-rotate-error"]:before {
  background: #e96a6a;
  color: #a33a3a;
}

.effeckt-button[data-loading] {
  cursor: default;
}

.effeckt-page-transition {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  visibility: hidden;
  overflow: hidden;
  background: #555;
}

.effeckt-page-transition-content{
  position: relative;
  top: 50%;
  left: 50%;
  width: 200px;
  margin: -100px 0 0 -100px;
  color: white;
}


.effeckt-off-screen-nav {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  background: #333;
  visibility: hidden;
  width: 12rem; // default, but some effects require different things
  ul {
    list-style: none;
  }
  li {
    &:first-child {
      a { border-top: 0; }
    }
    &:last-child {
      a { border-bottom: 0; }
    }
    a {
      display: block;
      padding: 0.3rem 1rem;
      color: white;
      border-bottom: 1px solid #444;
      &:hover, &:focus {
        background: #444;
      }
      &:active {
        background: #222;
      }
    }
  }
  // Make the close button move along with the header
  header {
    position: relative;
  }

  h4 {
    color: white;
    background: #333;
    border-bottom: 1px solid #eee;
    padding: 1rem 0.5rem 0.2rem 0;
    margin: 0 1rem 1rem;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.1rem;
    position: relative;
  }

}

.effeckt-off-screen-nav-close {
  position: absolute;
  right: 1rem;
  top: 0.65rem;
  font-size: 100%;
  z-index: 300;

  &:hover, &:focus {
    color: red;
  }
}
.effeckt-off-screen-nav-rotate.effeckt-off-screen-nav-show ~ .page-wrap .off-screen-nav-cover {
  background: linear-gradient(left, rgba(#eee, 0), rgba(#eee, 0.9));
}

.effeckt-off-screen-nav-top-card-deck,
.effeckt-off-screen-nav-bottom-card-deck {
  cursor: pointer;
  background: transparent;

  h4 {
    margin:0;
    padding: 1rem;
    border-bottom: 0;
  }

  li {
    background-color: #333;
    border-bottom:1px solid #eee;
  }

  a {
    height: 100%;
  }

  .effeckt-off-screen-nav-close {
    right: 1rem;
  }
}

.effeckt-off-screen-nav-bottom-card-deck {
  li {
    border-top:1px solid #eee;
    border-bottom:none;
  }
}

.effeckt-off-screen-nav-left-bounce,
.effeckt-off-screen-nav-left-bounce-out,
.effeckt-off-screen-nav-right-bounce,
.effeckt-off-screen-nav-right-bounce-out {
  box-sizing: content-box;
}


// The Captions
.effeckt-caption {
  float: left;
  overflow: hidden;
  width: 48%;
  margin: 0 4% 1rem 0;

  &:nth-child(2n) {
    margin-right: 0;
  }

  img {
    width: 100%;
    display: block;
  }

  figcaption {
    background: rgba(black, 0.8);
    color: white;
    padding: 1rem;

    h3 {
      font-size: 1.2rem;
    }

    p {
      margin: 0;
    }
  }
}


.effeckt-list {
  list-style: none;
  li {
    background: #e6e6e6;
    padding: 0 0.5rem;
    overflow: hidden;
    margin-bottom: 2px;
    line-height: 2;
    &.new-item {
      background: #ccc;
    }
  }
}


.effeckt-list-scroll {
  width: 230px;
  height: 480px;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  list-style: none;
  > li {
    padding: 0.5rem;
    background: #eee;
    color: #252525;
    font-size: 18px;
    &:nth-child(odd) {
      background: #e6e6e6;
    }
  }
}


// Contributors
.contributors-list {
  list-style: none;
  overflow: hidden;
  li {
    float: left;
    margin: 0 10px 10px 0;
  }
  img {
    width: 40px;
    height: 40px;
  }
}

// Extra pages (page transition testing)
[data-effeckt-page="page-1"] {
  background-color: #EEEEEE;
}
[data-effeckt-page="page-2"] {
  color: #203513;
  background-color: #99CF78;
}
[data-effeckt-page="page-3"] {
  color: #282828;
  background-color: #FECD3D;
}
[data-effeckt-page="page-4"] {
  color: #FFFEFE;
  background-color: #CD4F5B;
}
[data-effeckt-page="page-5"] {
  color: #194772;
  background-color:#62A1DC;
}

// Tabs
ul.effeckt-tabs {
  margin: 0;
  padding: 0;
  list-style: none;

  li {
    float: left;
    margin-right:2px;

    a {
      display: block;
      padding: 10px 15px;
      color: #383838;
      background-color: #EEEEEE;

      &.active, &:hover {
        background-color: #E8E8E8;
      }
    }
  }
}

.effeckt-tabs-container {
  padding:10px;
  margin-bottom: 20px;
  border:1px solid #DDD;

  .effeckt-tab-content {
    top: 10px;
  }
}

.effeckt-lazy-loading-options {
  margin:0 0 15px;
  label {
    margin: 0 5px;
  }
}
.effeckt-lazy-loading {
  // Maybe this won't work on many browsers
  // But the animations looks cooler like this.
  column-count:3;
  column-gap:0;
  li {
    display: block;
    list-style-type: none;
    padding: 0 5px 5px 0;
  }
  a {
    display: inline-block;
    background: #DDD;
    border:1px solid #ccc;
    width: 100%;
    height: 250px;
  }

  li:nth-child(1) a,
  li:nth-child(12n+12) a {
    height: 500px;
  }
  li:nth-child(3n+3) a {
    height: 350px;
  }
  li:nth-child(5n+5) a {
    height: 200px;
  }
}
